package self.hoy.demo.server.channel.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import self.hoy.demo.dubbo.domain.Channel;
import self.hoy.demo.dubbo.service.ChannelService;
import self.hoy.demo.server.channel.mapper.ChannelMapper;
import self.hoy.demo.server.channel.param.ChannelSearchParam;

import java.util.List;

/**
 * @author hyh
 * @date 2020/5/5
 */
@Service//(version = "20200505")
public class ChannelServiceImpl implements ChannelService {

    @Autowired
    private ChannelMapper channelMapper;

    @Override
    public Channel selectById(Integer id) {
        ChannelSearchParam param = new ChannelSearchParam();
        param.setChannelId(id);
        param.setMerchantId(20);
        List<Channel> list = channelMapper.getChanneList(param);
        return list == null || list.size() == 0 ? null : list.get(0);
    }
}
